import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/member/select_people/entity/people_info.dart';
import 'package:flutter_shop/pages/member/select_people/select_people_model.dart';
import 'package:flutter_shop/widget/tree_select/tree_node.dart';
import 'package:flutter_shop/widget/tree_select/tree_state.dart';

/// Title:SelectPeoplePage <br/>
/// Description: <br/>
/// author:xiemiao <br/>
/// date: 2020-04-17  <br/>
/// version 1.0 <br/>
class SelectPeoplePage extends StatefulWidget {
  SelectPeoplePage({Key key}) : super(key: key);

  @override
  _SelectPeoplePageState createState() => _SelectPeoplePageState();
}

class _SelectPeoplePageState extends TreeState<SelectPeoplePage, PeopleInfo> {
  @override
  String getTitle() {
    return "选择朋友";
  }

  @override
  TreeConfig getTreeConfig() {
    return TreeConfig(
      isMultiSelect: true,
      expandLevel: 2,
    );
  }

  @override
  Future<List<TreeNode>> getTreeList() async {
    List<PeopleInfo> list = await SelectPeopleModel().getPeopleTree();
    return list;
  }
}
